package com.dream.service.user.dao;

import com.dream.service.user.domain.model.UserCollectionModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by kangd on 2016/5/3.
 */
public interface UserCollectionDao {


    /**
     * 根据pin查询 WishList个数
     * @param pin
     * @return
     * @throws Exception
     */
    public int wishListCountByPIN(@Param("pin")String pin) throws Exception;

    /**
     * 根据pin查询
     * @param pin
     * @param startNum
     * @param PageSize
     * @return
     * @throws Exception
     */
    public List<UserCollectionModel> selectByPIN(@Param("pin")String pin,@Param("start_num")Integer startNum, @Param("page_size")Integer PageSize) throws  Exception;


    /**
     * 查询已经关注的spu
     * @param pin
     * @param spuList
     * @return
     * @throws Exception
     */
    public List<Long> selectByPINCollection(@Param("pin")String pin,@Param("spuList")List<Long> spuList) throws  Exception;

    /**
     * 增加收藏
     * @param pin
     * @param spuList
     * @return
     * @throws Exception
     */
    public int addUserCollection(@Param("pin")String pin, @Param("spuList")List<Long> spuList) throws Exception;

    /**
     * 删除收藏
     * @param pin
     * @param spuList
     * @return
     * @throws Exception
     */
    public int delUserCollection(@Param("pin")String pin, @Param("spuList")List<Long> spuList) throws Exception;

    /**
     *  只返回用户收藏的商品spu数据
     * @param pin
     * @param num 限定返回数量
     * @return
     * @throws Exception
     */
    public List<Long> selectSpusByPIN(@Param("pin") String pin,@Param("num")int num) throws Exception;

}
